const path = require('path');

const port = process.env.port || process.env.npm_config_port || 9528 // dev port

module.exports = {
  outputDir:process.env.outputDir,
  configureWebpack:{
    resolve:{   
      alias:{
        '@':path.resolve(__dirname, './src'),
        '@css':path.resolve(__dirname, './src/assets/css'),
        '@js':path.resolve(__dirname, './src/assets/js'),
        '@img':path.resolve(__dirname, './src/assets/img'),
        '@c':path.resolve(__dirname, './src/components'),
        } 
      }
    },

    publicPath: '/',
    assetsDir: 'static',
    lintOnSave: process.env.NODE_ENV === 'development',
    productionSourceMap: false,
    devServer: {
      port: port,
      open: true,
      overlay: {
        warnings: false,
        errors: true
      },
      proxy: {
        [process.env.VUE_APP_BASE_API]: {
          target: `http://47.96.91.77:8050/api`,
          changeOrigin: true,
          pathRewrite: {
            ['^' + process.env.VUE_APP_BASE_API]: ''
          }
        }
      }
    }
}